<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        这个游戏机是:{{price}},含税价格{{price1}}元,折合人民币{{price2}}元。
        <button @click="btnclick(10800)">含税价格10800</button>
    </div>
</body>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            price: 129999999
        },
        methods: {
            btnclick(newprice) {
                this.price1 = newprice;
            }
        },
        computed: {
            price1: {
                //return Math.round(this.price*1.08);

                get: function () {
                    return this.price * 1.08;
                },
                set: function (value) {
                    return this.price = value / 1.08;
                },
            },
            price2: function () {
                return Math.round(this.price / 16.75);

            }
        }

    })
</script>

</html>